// Fill out your copyright notice in the Description page of Project Settings.


#include "DataAsset/AttributeInfo.h"

FAttributeInformation UAttributeInfo::FindAttributeInformationByTag(const FGameplayTag& AttributeTag,
                                                                    const bool bLogIfNotFound)
{
	for (FAttributeInformation& Information : AttributeInformationArray)
	{
		/** 精确匹配标签 */
		if (Information.AttributeTag.MatchesTagExact(AttributeTag))
		{
			return Information;
		}
	}

	if (bLogIfNotFound)
	{
		UE_LOG(LogTemp,Error,TEXT("无法从数据列表[%s]中找到对应AttributeTag[%s]"),*GetNameSafe(this),*AttributeTag.ToString())
	}
	return FAttributeInformation();
}
